<template>
  <div class="app-container feedback-container minH">
    <div class=" radius10 hidden pb15 flex1 bgwhite  flex-col">
      <div class="flex1 w100p ">
        <el-table :data="tableData" style="width: 100%" cell-class-name="tbcell" header-cell-class-name="hdcell">
          <el-table-column prop="desc" label="描述" width="200" />
          <el-table-column prop="value" label="值">
            <template #default="scope">
              <p class="multi-line">{{ scope.row.value }}</p>
            </template>
          </el-table-column>
          <el-table-column prop="" label="操作" width="120" align="right">
            <template #default="scope">
              <div class=" pointer" @click="edit(scope.row)">編輯</div>
              <!-- <el-button>編輯</el-button> -->
            </template>
          </el-table-column>
        </el-table>
      </div>

      <div class="  plr20 mlauto mt15">
        <el-pagination v-model:current-page="currentPage" prev-text="上一頁" next-text="下一頁" :default-page-size="15"
          :small="small" :disabled="disabled" :background="true" layout="prev, pager, next, jumper" :total="total"
          @size-change="handleSizeChange" @current-change="handleCurrentChange" />
      </div>
    </div>

  </div>
</template>

<script setup>
import { Search } from '@element-plus/icons-vue'
import { ref, onMounted } from 'vue'
import { useRouter } from 'vue-router';
import { settingList } from '@/api/system.js'
onMounted(() => {
  getSettingList()
})
const getSettingList = () => {
  settingList({ page: currentPage.value }).then((res) => {
    console.log('系统参数列表', res)
    tableData.value = res.data.data
    total.value = res.data.total
  })
}
const tableData = ref([])
const tableRowClassName = () => {
  return 'tbrow'
}
const currentPage = ref(1)
const total = ref(0)
const handleSizeChange = (val) => {
  console.log(`${val} items per page`)
}
const handleCurrentChange = (val) => {
  console.log(`current page: ${val}`)
}
const router = useRouter()
const edit = (row) => {
  console.log(router)
  router.push({ path: 'editParam', query: row })
}
</script>

<style lang="scss" scoped>
.feedback-container {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.search {
  overflow: hidden;
  border-radius: 10px !important;
  padding: 5px 0px;
}

.multi-line {
  -webkit-line-clamp: 3;
  text-overflow: ellipsis;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}
</style>
<style>
:deep(.el-input__wrapper.is-focus) {
  box-shadow: 0 0 0 1px #3e4366 inset;
}
</style>
